# -*- coding: utf-8 -*-
# Python中默认的编码格式是 ASCII 格式，在没修改编码格式时无法正确打印汉字，所以在读取中文时会报错。

import random
import uuid


class Animal(object):

    def __init__(self, name):
        self.name = name
        self.age = 23


    def tet_1(self):
         self.tet()

    def tet(self):
        pass


class Dog(Animal):

    def __init__(self, name):
        super(Dog, self).__init__(name)                     # 继承标准语句
        self.breed = random.choice(['Doberman', 'German shepherd', 'Beagle'])       # 随机选择

    @classmethod
    def __fecth__(cls, thing):
        print(thing)

    def tet(self):
        print("tet")


d = Dog('黑皮')
d1 = Dog
print(d1)
# print(d1.name)             # d1 是类 没有具体的属性，用.name会报错
print(d)
print(d.name)
print(d.breed)
print(d.tet_1())
# d.fetch(1)
del d.name              # 可以使用del删除实例的name属性
# print(d.name)         # 删除后会报错



# python可以多继承
# 尽量少用多继承
class Base(object):
    def test(self):
        print("------base")

class A(Base):
    def test1(self):
        print("-----test1")


class B(Base):
    def test2(self):
        print("----test2")

class C(A, B):
    pass

c = C()
c.test1()
c.test2()
c.test()


